<?php

namespace App;

class Comment extends Model
{
    protected $table = 'comments';

    protected $primaryKey = 'id';

    //评论查找文章一对多反向
    public function post()
    {
        return $this->belongsTo('\App\Post');
    }

    //评论所属用户一对多反向
    public function user()
    {
        return $this->belongsTo('\App\User');
    }
}
